#include "scorepanel.h"
#include "ui_scorepanel.h"

#include <QFont>
const QString MYCOLOR[] = {"black","white","red","blue","green"};
ScorePanel::ScorePanel(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ScorePanel)
{
    ui->setupUi(this);
    m_list<<ui->leftScore<<ui->rightScore<<ui->meScore
           <<ui->label<<ui->label_3<<ui->label_4
           <<ui->label_6<<ui->label_8<<ui->label_9;
}

ScorePanel::~ScorePanel()
{
    delete ui;
}

void ScorePanel::setScore(int left, int right, int user)
{
    ui->meScore->setText(QString::number(user));
    ui->leftScore->setText(QString::number(left));
    ui->rightScore->setText(QString::number(right));
}

void ScorePanel::setMyFontColor(FontColor color)
{
	QString style = QString("QLabel{color:%1}").arg(MYCOLOR[color]);
    for(int i = 0 ;i<m_list.size();++i)
    {

        m_list[i]->setStyleSheet(style);
    }
}

void ScorePanel::setMyFontSize(int point)
{
    QFont font("微软雅黑",point,QFont::Bold);
    for(int i = 0 ;i<m_list.size();++i)
    {
        m_list[i]->setFont(font);
    }
}
